<template>
  <div>
    <h1>Footer--{{ price }}</h1>
    <button @click="decrement({n:10})">累减</button>
  </div>
</template>

<script>
import { mapMutations } from 'vuex';
export default {
  name: "Footer",

  computed: {
    price() {
      return this.$store.state.price;
    },
  },
  methods: {
    // decrement(n) {
    //   this.$store.commit('decrement',{n})
    // },
    // ...mapMutations(['decrement'])
    
    ...mapMutations({decrement:'decrement'})
    
  },
};
</script>

<style>
</style>